package mock.servicesdirectory.web.action;

import com.opensymphony.xwork2.ActionSupport;


public class Login extends ActionSupport {


	private String loginuser;
	private String loginpassword;
	private String echo;

	public String execute() throws Exception {
		if (loginuser.equals("")|| loginuser.isEmpty()) {
			echo = "User Name must not empty !";
			return SUCCESS;
		}
		if (loginpassword.equals("")||loginpassword.isEmpty()) {
			echo = "Password must not empty !";
			return SUCCESS;
		}
		if(loginpassword.equals("test")){
			echo="Welcome"+loginuser;
			return SUCCESS;
		}
		echo = "wrong login!";
		return SUCCESS;
	}

	public String getEcho() {
		return echo;
	}

	public String getLoginuser() {
		return loginuser;
	}

	public void setLoginuser(String loginuser) {
		this.loginuser = loginuser;
	}

	public String getLoginpassword() {
		return loginpassword;
	}

	public void setLoginpassword(String loginpassword) {
		this.loginpassword = loginpassword;
	}
}
